
#pragma once

#include "vix.h"
#include "VirtualMachine.h"

// Yes it's bad to using namespace in .h Whatever! //
using namespace System;
using namespace VirtualOps::Base;

namespace VirtualOps { namespace Vix {

    public ref class VixServer : public VmServer
	{
    public: 
        VixServer() {}
        
        ~VixServer() { Disconnect(); }
        
        virtual array<IVirtualMachine^ >^ GetAllVms() override;
        
        void Connect(String^ userName, String^ passWord);
        
        void Disconnect();
        
        virtual property bool Connected 
        { 
            bool get() override { return _hostHandle != VIX_INVALID_HANDLE; } 
        }

        VirtualMachine^ GetVmByPath(String^ vmPath);

    private:
        VixHandle _hostHandle;

        };

} } // namespace VirtualOps::Vix


